﻿//-----------------------------------------------------------------------
// <copyright file="Type.cs" company="tuliprules.org">
//     Copyright (c) 2010 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the Type class.</summary>
//-----------------------------------------------------------------------

namespace Tulip.Engine.Models.ClosedWorld
{
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Windows.Markup;
    using Collections;

    /// <summary>
    /// Represents a .NET type used within the runtime model.
    /// </summary>
    [ContentProperty("Members")]
    public class Type : ElementBase
    {
        /// <summary>
        /// Initializes a new instance of the Type class.
        /// </summary>
        public Type()
        {
            this.Members = new Members();
        }

        /// <summary>
        /// Gets or sets the name of .NET assembly that packages the bound type.
        /// </summary>
        public string AssemblyRef { get; set; }

        /// <summary>
        /// Gets or sets the kind of .NET type (class, struct, etc).
        /// </summary>
        public TypeKind TypeKind { get; set; }

        /// <summary>
        /// Gets or sets the visibilty of bound .NET type (public, provate, etc).
        /// </summary>
        public TypeVisibility TypeVisibility { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the bound .NET type is static.
        /// </summary>
        public bool IsStatic { get; set; }

        /// <summary>
        /// Gets or sets the name of generoc typeargument.
        /// </summary>
        public string GenericTypeArgument { get; set; }

        /// <summary>
        /// Gets the collection of type members.
        /// </summary>
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public IList<Member> Members { get; private set; }
    }
}
